<?php
require_once('connect.php');
require_once('controller/list-product.php');
if(isset($_GET['fast'])) $fast=1;
foreach($listpro as $item )
	{
		if(is_array($item))
		{
			if(isset($fast) && $fast==1)
			{
		?>
				 
                     <a href="<?php echo $url.'detail-product/'.$lib->makeTitle($item['title']).'/'.$item['id'] ?>.html">
                     	<img  src="<?php echo $item['image'] ?>" alt=""/>
                        <p><?php  echo $lib->cut_string($item['title'],100); ?></p>
                       
                     </a>
                
		
		<?php	
			}
			else
			{
		?>
<section class="item-box" style="width:251px !important">
    <figure class="picture">
        <a href="<?php echo $url.'detail-product/'.$lib->makeTitle($item['title']).'/'.$item['id'] ?>.html">
        <img src="<?php echo $item['image'] ?>" alt="<?php echo $item['title'] ?>"/>
        </a>
    </figure>
    <section class="more-detail">
        <h3>
        	<a href="<?php echo $url.'detail-product/'.$lib->makeTitle($item['title']).'/'.$item['id'] ?>.html">
            <?php
			
				if((strlen($item['title'])>100))
				{
					echo $lib->cut_string($item['title'],100);
				}
				else echo $item['title'];
			
			?>
            </a>
        </h3>
        <p>Giá niêm yết : <span class="redPrice"><?php echo number_format($item['price']); ?></span> đ </p>
        <section class="group">
            <section class="promotion group-info">
                <ul>
                    <li>Giảm 200.000đ-> 300.000đ mua Combo PK</li>
                    <li>Tặng lò xo bảo vệ dây sạc</li>
                    <li>Tặng voucher combo“Office 365 + ebook Alezaa & Greelane” trị giá 1.500.000đ</li>
                </ul>
            </section><!--end .promotion-->
            <section class="info-config group-info">
                <ul>
                    <li>CPU: Intel core i5, 1.4GHz (3MB L3 Cache,up to 2.6GHz)</li>
                    <li>RAM: 4GB of onboard 1600MHz DDR3L</li>
                    <li>HDD: 256GB of Flash Storage</li>
                    <li>Display: 13.3-inch (diagonal) LED-backlit glossy</li>
                    <li>Intel HD Graphics 5000</li>
                    <li>802.11ac Wi-Fi and Bluetooth 4.0</li>
                    <li>720p FaceTime HD camera</li>
                </ul>
            </section><!--end .info-config-->
        </section>
        <section class="button clearfix">
            <input onclick="location.href='<?php echo $url.'detail-product/'.$lib->makeTitle($item['title']).'/'.$item['id'] ?>.html'"
             	class="blueBtn" 
            	 type="button" 
             	value="MUA NGAY">
            <input onclick="location.href='<?php echo $url.'detail-product/'.$lib->makeTitle($item['title']).'/'.$item['id'] ?>.html'" 
            	class="blueBtn" 
                type="button" 
                value="THÊM VÀO GIỎ">
            <input onclick="location.href='<?php echo $url.'detail-product/'.$lib->makeTitle($item['title']).'/'.$item['id'] ?>.html'"
            	class="greyBtn" 
                type="button" 
                value="CHI TIẾT">
            <input class="greyBtn" type="button" value="YÊU THÍCH">
        </section><!--end .button-->
    </section>
</section><!--end .item-box-->
<?php
			}
		}
	}
	
	?>